/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package piu;

import classes.Informacoes;
import classes.Pedido;
import javax.swing.ImageIcon;

/**
 *
 * @author Dalay
 */
public class FazerPedidosYakisoba extends javax.swing.JFrame {

    /**
     * Creates new form FazerPedidosYakisoba
     */
    public FazerPedidosYakisoba() {
        initComponents();
        im.setIcon(imagem);
        text_Preco.setEditable(false);
        
        text_Preco.setText(preco+"");
    text_Preco.setText(preco*mult+"");
    }
        float preco = (float) 49.99;
        float precoi = (float) 49.99;
        int mult = 0;
    
        ImageIcon imagem = new ImageIcon("src/Imagens/yakisoba.jpg");

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        button_Cardapio = new javax.swing.JButton();
        button_FazerLogin = new javax.swing.JButton();
        button_Contato = new javax.swing.JButton();
        label_FazerPedidos = new javax.swing.JLabel();
        button_Inicio = new javax.swing.JButton();
        yakisoba = new javax.swing.JLabel();
        im = new javax.swing.JLabel();
        label_Descricao3 = new javax.swing.JLabel();
        label_Descricao = new javax.swing.JLabel();
        label_Descricao2 = new javax.swing.JLabel();
        button_FecharCompra = new javax.swing.JButton();
        button_AddPedido = new javax.swing.JButton();
        label_Preco = new javax.swing.JLabel();
        text_Preco = new javax.swing.JTextField();
        sp = new javax.swing.JSpinner();
        label_Qtd = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        button_Cardapio.setText("Cardápio");
        button_Cardapio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_CardapioActionPerformed(evt);
            }
        });

        button_FazerLogin.setText("Fazer Login");
        button_FazerLogin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_FazerLoginActionPerformed(evt);
            }
        });

        button_Contato.setText("Contato");
        button_Contato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_ContatoActionPerformed(evt);
            }
        });

        label_FazerPedidos.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        label_FazerPedidos.setText("Fazer Pedidos");

        button_Inicio.setText("Inicio");
        button_Inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_InicioActionPerformed(evt);
            }
        });

        yakisoba.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        yakisoba.setText("Yakisoba");

        label_Descricao3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        label_Descricao3.setText("temperados com molho shoyu");

        label_Descricao.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        label_Descricao.setText("Descrição: Macarrão Oriental, acompanhado de");

        label_Descricao2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        label_Descricao2.setText("seleção de carlos(conforme opção) e legumes");

        button_FecharCompra.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        button_FecharCompra.setText("Fechar Compra");
        button_FecharCompra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_FecharCompraActionPerformed(evt);
            }
        });

        button_AddPedido.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        button_AddPedido.setText("Add Pedido");
        button_AddPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_AddPedidoActionPerformed(evt);
            }
        });

        label_Preco.setText("Preço:");

        sp.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                spStateChanged(evt);
            }
        });

        label_Qtd.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        label_Qtd.setText("Qtd.:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(label_Descricao)
                    .addComponent(label_Descricao2)
                    .addComponent(label_Descricao3))
                .addGap(18, 18, 18))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(82, 82, 82)
                            .addComponent(label_FazerPedidos)
                            .addGap(53, 53, 53))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(button_Inicio)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(button_Cardapio)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(button_FazerLogin)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(button_Contato)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addComponent(button_AddPedido)
                        .addGap(33, 33, 33)
                        .addComponent(button_FecharCompra))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(43, 43, 43)
                        .addComponent(label_Qtd)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(sp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(61, 61, 61)
                        .addComponent(label_Preco)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(text_Preco, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(129, 129, 129)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(yakisoba)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addComponent(im)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(label_FazerPedidos)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(button_Inicio)
                            .addComponent(button_Cardapio)
                            .addComponent(button_FazerLogin)
                            .addComponent(button_Contato))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(yakisoba))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 194, Short.MAX_VALUE)
                        .addComponent(jLabel3)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(im)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_Qtd)
                    .addComponent(label_Preco)
                    .addComponent(text_Preco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(label_Descricao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(label_Descricao2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(label_Descricao3)
                .addGap(29, 29, 29)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(button_AddPedido)
                    .addComponent(button_FecharCompra))
                .addGap(24, 24, 24))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void button_InicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_InicioActionPerformed
        new ComidaEmCasaAPP().setVisible(true);
        this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_button_InicioActionPerformed

    private void button_CardapioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_CardapioActionPerformed
        new Pratos().setVisible(true);
        this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_button_CardapioActionPerformed

    private void button_ContatoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_ContatoActionPerformed
        new Contato().setVisible(true);
        this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_button_ContatoActionPerformed

    private void spStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spStateChanged
        mult = (int) sp.getValue();
        preco = mult*precoi;
        text_Preco.setText(preco+"");      // TODO add your handling code here:
    }//GEN-LAST:event_spStateChanged

    private void button_AddPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_AddPedidoActionPerformed
        Pedido p = new Pedido();
        p.quant = mult;
        p.valor = preco*mult;
        p.prato = yakisoba.getText();
        Informacoes.pedidos.add(p);
        
        
        new PedidoAdicionado().setVisible(true);
        this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_button_AddPedidoActionPerformed

    private void button_FazerLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_FazerLoginActionPerformed
        new FazerLogin().setVisible(true);
        this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_button_FazerLoginActionPerformed

    private void button_FecharCompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_FecharCompraActionPerformed
        new FazerLogin().setVisible(true);
        this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_button_FecharCompraActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FazerPedidosYakisoba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FazerPedidosYakisoba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FazerPedidosYakisoba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FazerPedidosYakisoba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FazerPedidosYakisoba().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton button_AddPedido;
    private javax.swing.JButton button_Cardapio;
    private javax.swing.JButton button_Contato;
    private javax.swing.JButton button_FazerLogin;
    private javax.swing.JButton button_FecharCompra;
    private javax.swing.JButton button_Inicio;
    private javax.swing.JLabel im;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel label_Descricao;
    private javax.swing.JLabel label_Descricao2;
    private javax.swing.JLabel label_Descricao3;
    private javax.swing.JLabel label_FazerPedidos;
    private javax.swing.JLabel label_Preco;
    private javax.swing.JLabel label_Qtd;
    private javax.swing.JSpinner sp;
    private javax.swing.JTextField text_Preco;
    private javax.swing.JLabel yakisoba;
    // End of variables declaration//GEN-END:variables
}
